<template>
  <div class="podcast">
    <!-- 两边按键 -->
    <div>
      <van-nav-bar left-text="返回" left-arrow>
        <template #left>
          <span><img src="../../assets/hengpai.png" alt="" class="I1" /></span>
        </template>
        <template #right>
          <span><img src="../../assets/jiahao.png" alt="" class="I2" /></span>
        </template>
      </van-nav-bar>
    </div>
    <!-- 两边按键 -->
    <!-- 中间文字 -->
    <van-tabs v-model="activeName" class="tuijian">
      <van-tab title="推荐" name="a"></van-tab>
      <van-tab title="故事" name="b" class="gushiB"></van-tab>
    </van-tabs>
    <!-- 中间文字 -->
    <!-- 搜索框 -->
    <van-search
      v-model="value"
      shape="round"
      placeholder="大家都在听 樱花日语"
    />
    <!-- 搜索框 -->
    <!-- 五大圆圈 -->
    <van-row type="flex" justify="space-between" class="laoda">
      <van-col span="1.5">
        <div>
          <div class="wodeboke quan">
            <img src="../../assets/xinhao.png" alt="" class="wodeboke1" />
          </div>
          <p class="wodeboke2">我的博客</p>
        </div>
      </van-col>
      <van-col span="1.5">
        <span>
          <div>
            <div class="wodeboke cuihua">
              <img src="../../assets/siyecao.png" alt="" class="quanbufenlei" />
            </div>
            <p class="wodeboke2">全部分类</p>
          </div>
        </span>
      </van-col>
      <van-col span="1.5">
        <span>
          <div>
            <div class="wodeboke cuihua1">
              <img
                src="../../assets/shuzhuangtu.png"
                alt=""
                class="paihangbang"
              />
            </div>
            <p class="wodeboke3">排行榜</p>
          </div>
        </span>
      </van-col>
      <van-col span="1.5">
        <span>
          <div>
            <div class="wodeboke cuihua2">
              <img src="../../assets/shu2.png" alt="" class="tingshu" />
            </div>
            <p class="wodeboke4">听书</p>
          </div>
        </span>
      </van-col>
      <van-col span="1.5">
        <span>
          <div>
            <div class="wodeboke cuihua3">
              <img src="../../assets/renqun.png" alt="" class="renqun" />
            </div>
            <p class="wodeboke3">一起听</p>
          </div>
        </span>
      </van-col>
    </van-row>
    <!-- 五大圆圈 -->
    <!-- 猜你喜欢 -->
    <div class="box">
      <div class="xihuan">
        <van-icon name="replay" />
        <span class="xh">猜你喜欢</span>
      </div>
      <div class="xingqu">兴趣定制></div>
      <!-- 猜你喜欢 -->
      <!-- 中间部分 -->
      <van-row type="flex" justify="space-between" class="zhongjian">
        <van-col
          span="8"
          v-for="(item, index) in list"
          :key="index"
          @click="woshisahbi(item.id)"
        >
          <div class="fangge">
            <img :src="item.coverImgUrl" alt="" />
            <div class="bofangliang">
              ▷{{ parseInt(item.playCount / 10000) }}万
            </div>
          </div>
          <p class="wenben"><span>热门</span>{{ item.name }}</p>
        </van-col>
      </van-row>
      <!-- 中间部分 -->
      <!-- 电音部分 -->
      <div class="xihuan">
        <span class="xh1">电音</span>
      </div>
      <div class="xingqu1">更多></div>
      <van-row type="flex" justify="space-between" class="zhongjian">
        <van-col
          span="8"
          v-for="(llb, index) in boss"
          :key="index"
          @click="woshierbi(llb.id)"
        >
          <div class="fangge">
            <img :src="llb.coverImgUrl" alt="" />
            <div class="bofangliang">
              ▷{{ parseInt(llb.playCount / 10000) }}万
            </div>
          </div>
          <p class="wenben"><span>热门</span>{{ llb.name }}</p>
        </van-col>
      </van-row>
    </div>
    <!-- 电音部分 -->
    <!-- 故事部分 -->
    <div class="xihuan">
      <span class="xh1">故事</span>
    </div>
    <div class="xingqu2">更多></div>
    <!-- 故事部分 -->
    <div class="weifangge" v-if="huo[0]">
      <div
        class="weifanggezuo"
        v-for="(xhx, index) in huo[0].radios"
        :key="index"
        @click="woshishanbi(xhx.id)"
      >
        <div class="weifanggetou">
          <img :src="xhx.picUrl" alt="" />
        </div>
        <p class="weifanggeyou">{{ xhx.lastProgramName }}</p>
        <p class="weifanggeyou1">{{ xhx.rcmdText }}</p>
        <p class="weifanggeyou2">{{ xhx.name }}</p>
      </div>
    </div>
    <!-- 故事部分 -->
  </div>
</template>

<script>
import { Toast } from "vant";
import "../../assets/font-follow/vantChange1.css";
import axios from "axios";
export default {
  data() {
    return {
      activeName: "a",
      value: "",
      list: [], //通过歌单分类接口调取歌单
      boss: [], //通过电台分类接口调取电台
      huo: [], //通过电台分类接口调用电台分类
    };
  },
  computed: {},
  watch: {},

  methods: {
    async musiclist() {
      const result = await axios.get(
        "http://192.168.31.27:3000/top/playlist/top/playlist?limit=6&offset=6"
      );
      // console.log(result);
      this.list = result.data.playlists;
      // console.log(this.list);
    },
    async musiclists() {
      const result = await axios.get(
        "http://192.168.31.27:3000/top/playlist/highquality?limit=3"
      );
      // console.log(result);
      this.boss = result.data.playlists;
    },
    async musiclistss() {
      const result = await axios.get(
        "http://192.168.31.27:3000/dj/category/recommend"
      );
      // console.log(result);
      this.huo = result.data.data;
      // console.log(this.huo);
    },
    // 获取歌单所有歌曲
    woshisahbi(id) {
      // console.log(id);
      this.$router.push("/songlistdetails/" + id);
    },
    woshierbi(id) {
      // console.log(id);
      this.$router.push("/songlistdetails/" + id);
    },
    woshishanbi(id) {
      // console.log(id);
      this.$router.push("/songlistdetails/" + id);
    },
  },
  created() {
    this.musiclist();
    this.musiclists();
    this.musiclistss();
  },
  mounted() {},
  components: {},
};
</script>
<style scoped>
.podcast {
  margin-bottom: 100px;
}
.I1 {
  width: 23px;
  height: 23px;
  position: absolute;
  left: 10px;
  top: 9px;
}
.I2 {
  width: 32px;
  height: 32px;
  float: right;
  position: absolute;
  right: 10px;
  top: 6px;
}
.tuijian {
  position: absolute;
  top: 0;
  left: 133px;
  z-index: 1;
}
.wodeboke {
  width: 60px;
  height: 60px;
  border-radius: 30px;
  border: 1px solid rgba(175, 168, 168, 0);
  margin-left: 10px;
}

.quan {
  border: 1px solid rgb(231, 22, 22);
}
.wodeboke .wodeboke1 {
  display: block;
  width: 60px;
  height: 30px;
  margin-top: 13px;
}
.quanbufenlei {
  width: 30px;
  height: 30px;
  margin-left: 15px;
  margin-top: 15px;
}
.paihangbang {
  width: 38px;
  height: 38px;
  margin-left: 13px;
  margin-top: 10px;
}
.tingshu {
  width: 50px;
  height: 35px;
  margin-left: 7px;
  margin-top: 13px;
}
.renqun {
  width: 40px;
  height: 40px;
  margin-left: 11px;
  margin-top: 8px;
}
.wodeboke2 {
  margin-left: 10px;
  margin-top: 10px;
}
.wodeboke3 {
  margin-left: 16px;
  margin-top: 10px;
}
.wodeboke4 {
  margin-left: 23px;
  margin-top: 10px;
}
.cuihua {
  background-image: linear-gradient(
    to right,
    rgba(95, 102, 50, 0.658),
    rgba(153, 138, 53, 0.247)
  );
}
.cuihua1 {
  background-image: linear-gradient(
    to right,
    rgba(174, 118, 190, 0.425),
    rgba(175, 68, 179, 0.61)
  );
}
.cuihua2 {
  background-image: linear-gradient(
    to right,
    rgba(74, 125, 182, 0.808),
    rgba(102, 179, 185, 0.548)
  );
}
.cuihua3 {
  background-image: linear-gradient(
    to right,
    rgba(35, 62, 95, 0.808),
    rgba(6, 26, 70, 0.705)
  );
}
.laoda .wodeboke:hover {
  background: pink;
}
/* 猜你喜欢模块 */
.box {
  padding-top: 30px;

  position: relative;
}
.xihuan {
  /* float: left; */
  border: 1px solid rgba(0, 0, 0, 0);
  line-height: 30px;
  border-radius: 30px;
  margin-left: 10px;
  margin-bottom: 20px;
}
.xihuan .xh {
  font-weight: 700;
  font-size: 20px;
}
.xingqu {
  width: 70px;
  height: 70px;
  position: absolute;
  right: 10px;
  top: 31px;
  height: 26px;
  text-align: center;
  border: 1px solid #000;
  line-height: 26px;
  border-radius: 30px;
  margin-right: 10px;
  font-size: 12px;
}
.xh1 {
  display: block;
  margin-left: 10px;
  margin-top: 16px;
  font-weight: 700;
  height: 26px;
  border: 1px solid rgba(0, 0, 0, 0);
  line-height: 26px;
  border-radius: 30px;
  margin-right: 10px;
  font-size: 20px;
}
.xingqu1 {
  width: 70px;
  height: 70px;
  font-size: 12px;
  position: absolute;
  top: 447px;
  right: 0;
  float: right;
  margin-right: 30px;
  height: 26px;
  text-align: center;
  border: 1px solid #000;
  line-height: 26px;
  border-radius: 30px;
}
.xingqu2 {
  width: 70px;
  height: 70px;
  font-size: 12px;
  position: absolute;
  top: 895px;
  right: 0;
  float: right;
  margin-right: 30px;
  height: 26px;
  text-align: center;
  border: 1px solid #000;
  line-height: 26px;
  border-radius: 30px;
}
.fangge {
  width: 100px;
  height: 100px;
  border: 1px solid #000;
  border-radius: 20px;
  overflow: hidden;
  margin-top: 10px;
}
.weifangge {
  /* width: 100px; */
  /* height: 300px; */
  /* border: 1px solid #000; */
  border-radius: 20px;
  padding-bottom: 26%;
}
.weifangge img {
  width: 100%;
  height: 100%;
}
.weifanggezuo {
  margin-top: 10px;
  height: 100px;
  /* border: 1px solid #000; */
  border-radius: 20px;
  overflow: hidden;
  margin-left: 32px;
  margin-top: 26px;
}
.weifanggetou {
  float: left;
  width: 100px;
  height: 100px;
  /* border: 1px solid #000; */
  border-radius: 20px;
  overflow: hidden;
  margin-right: 16px;
  margin-top: 1px;
}
/* .weifangge p {
  width: 340px;
  margin-top: 9px;
  line-height: 18px;
} */
.weifanggeyou {
  width: 380px;
  margin-top: 16px;
  font-size: 15px;
}
.weifanggeyou1 {
  overflow: hidden;
  margin-top: 6px;
  width: 90px;
  margin-left: 100px;
  border-radius: 6px;
  font-size: 12px;
  line-height: 20px;
  height: 20px;
  border: 1px solid #000;
  padding-left: 8px;
  padding-right: 5px;
}
.weifanggeyou2 {
  font-size: 13px;
  margin-top: 9px;
  color: #999898;
}
.fangge img {
  width: 100%;
  height: 100%;
}
.wenben {
  width: 95px;
  display: block;
  margin-left: 8px;
  font-size: 12px;
  float: left;
  margin-top: 10px;
}
.wenben span {
  margin-right: 4px;
  margin-top: 3px;
}
.zhongjian {
  position: relative;
}
.bofangliang {
  position: absolute;
  margin-left: 39px;
  margin-top: -99px;
  /* width: 60px; */
  text-align: center;
  line-height: 20px;
  height: 20px;
  /* border: 1px solid #000; */
  color: #fff;
  background-image: linear-gradient(
    to right,
    rgba(129, 131, 146, 0.411),
    rgba(150, 153, 158, 0.404)
  );
  border-radius: 30px;
}
.wenben {
  line-height: 18px;
}
</style>
